<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="generator" content="Hugo 0.37.1" />
    <meta name="description" content="">


    <link rel="shortcut icon" href="https://shardingsphere.apache.org/document/legacy/3.x/document/img/favicon.png" type="image/x-icon" />

    <title>FAQ :: ShardingSphere</title>
    
    
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/nucleus.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/font-awesome.min.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/hybrid.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/featherlight.min.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/perfect-scrollbar.min.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/auto-complete.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/theme.css?1547543307" rel="stylesheet">
    <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/hugo-theme.css?1547543307" rel="stylesheet">
    
      <link href="https://shardingsphere.apache.org/document/legacy/3.x/document/css/theme-black.css?1547543307" rel="stylesheet">
    

    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/jquery-2.x.min.js?1547543307"></script>
    
    <style type="text/css">
      :root #header + #content > #left > #rlblock_left{ 
          display:none !important;
      }
      
    </style>
    

  </head>
  <body class="" data-url="/en/faq/">
    <nav id="sidebar" class="">



  <div id="header-wrapper">
    <div id="header">
      <img src="https://shardingsphere.apache.org/document/legacy/3.x/document/img/logo_v2.png" />

    </div>
    
  </div>

    <div class="highlightable">
    <ul class="topics">

        
          
          


 
  
    
    <li data-nav-id="/en/overview/" title="Overview" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/overview/">
          <b>1. </b>Overview
          
      </a>
      
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/en/quick-start/" title="Quick Start" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/quick-start/">
          <b>2. </b>Quick Start
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/quick-start/sharding-jdbc-quick-start/" title="Sharding-JDBC" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/quick-start/sharding-jdbc-quick-start/">
        <b>2.1. </b>Sharding-JDBC
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/quick-start/sharding-proxy-quick-start/" title="Sharding-Proxy" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/quick-start/sharding-proxy-quick-start/">
        <b>2.2. </b>Sharding-Proxy
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/en/features/" title="Concepts &amp; Features" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/">
          <b>3. </b>Concepts &amp; Features
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/en/features/sharding/" title="Data sharding" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/">
          <b>3.1. </b>Data sharding
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/en/features/sharding/concept/" title="Core Concept" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/concept/">
          <b>3.1.1. </b>Core Concept
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/concept/sql/" title="SQL" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/concept/sql/">
        SQL
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/concept/sharding/" title="Sharding" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/concept/sharding/">
        Sharding
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/concept/configuration/" title="Configuration" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/concept/configuration/">
        Configuration
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/sharding/principle/" title="Guide to Kernel" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/">
          <b>3.1.1. </b>Guide to Kernel
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/principle/parse/" title="Parse Engine" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/parse/">
        Parse Engine
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/principle/route/" title="Route Engine" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/route/">
        Route Engine
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/principle/rewrite/" title="Rewrite Engine" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/rewrite/">
        Rewrite Engine
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/principle/execute/" title="Execute Engine" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/execute/">
        Execute Engine
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/principle/merge/" title="Merger Engine" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/principle/merge/">
        Merger Engine
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/sharding/use-norms/" title="Use Norms" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/use-norms/">
          <b>3.1.3. </b>Use Norms
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/use-norms/sql/" title="SQL" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/use-norms/sql/">
        SQL
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/use-norms/pagination/" title="Pagination" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/use-norms/pagination/">
        Pagination
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/sharding/other-features/" title="Other Features" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/other-features/">
          <b>3.1.4. </b>Other Features
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/other-features/inline-expression/" title="Inline Expression" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/other-features/inline-expression/">
        Inline Expression
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/other-features/key-generator/" title="Distributed Primary Key" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/other-features/key-generator/">
        Distributed Primary Key
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/sharding/other-features/sharding-hint/" title="Sharding Hint" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/sharding/other-features/sharding-hint/">
        Sharding Hint
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/read-write-split/" title="Read-write splitting" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/read-write-split/">
          <b>3.2. </b>Read-write splitting
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/read-write-split/concept/" title="Core Concept" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/read-write-split/concept/">
        <b>3.2.1. </b>Core Concept
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/read-write-split/core-features/" title="Core Features" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/read-write-split/core-features/">
        <b>3.2.2. </b>Core Features
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/read-write-split/unsupported-items/" title="Unsupported Items" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/read-write-split/unsupported-items/">
        <b>3.2.3. </b>Unsupported Items
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/orchestration/" title="Orchestration" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/orchestration/">
          <b>3.3. </b>Orchestration
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/orchestration/config-center/" title="Config Center" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/orchestration/config-center/">
        <b>3.3.1. </b>Config Center
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/orchestration/orchestration/" title="Orchestration" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/orchestration/orchestration/">
        <b>3.3.2. </b>Orchestration
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/orchestration/supported-registry-repo/" title="Available Registry Center" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/orchestration/supported-registry-repo/">
        <b>3.3.3. </b>Available Registry Center
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/orchestration/apm/" title="APM" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/orchestration/apm/">
        <b>3.3.4. </b>APM
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/features/transaction/" title="Distributed Transaction" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/transaction/">
          <b>3.4. </b>Distributed Transaction
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/features/transaction/local-transaction/" title="Local transaction" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/transaction/local-transaction/">
        <b>3.4.1. </b>Local transaction
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/transaction/2pc-transaction/" title="2PC Transaction" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/transaction/2pc-transaction/">
        <b>3.4.2. </b>2PC Transaction
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/features/transaction/base-transaction/" title="BASE Transaction" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/features/transaction/base-transaction/">
        <b>3.4.3. </b>BASE Transaction
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/en/manual/" title="User Manual" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/">
          <b>4. </b>User Manual
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/en/manual/sharding-jdbc/" title="Sharding-JDBC" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/">
          <b>4.1. </b>Sharding-JDBC
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/en/manual/sharding-jdbc/usage/" title="Manual" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/">
          <b>4.1.1. </b>Manual
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/usage/sharding/" title="Sharding" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/sharding/">
        Sharding
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/usage/read-write-splitting/" title="Read-write Splitting" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/read-write-splitting/">
        Read-write Splitting
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/usage/hint/" title="Hint" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/hint/">
        Hint
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/usage/orchestration/" title="Orchestration" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/orchestration/">
        Orchestration
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/usage/transaction/" title="Distribute Transaction" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/usage/transaction/">
        Distribute Transaction
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/manual/sharding-jdbc/configuration/" title="Configuration manual" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/configuration/">
          <b>4.1.2. </b>Configuration manual
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/configuration/config-java/" title="Java" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/configuration/config-java/">
        Java
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/configuration/config-yaml/" title="Yaml" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/configuration/config-yaml/">
        Yaml
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/configuration/config-spring-boot/" title="Spring Boot" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/configuration/config-spring-boot/">
        Spring Boot
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/configuration/config-spring-namespace/" title="Spring Namespace" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/configuration/config-spring-namespace/">
        Spring Namespace
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/unsupported-items/" title="Unsupported JDBC Items" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/unsupported-items/">
        <b>4.1.3. </b>Unsupported JDBC Items
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-jdbc/stress-test/" title="Performance Test" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-jdbc/stress-test/">
        <b>4.1.4. </b>Performance Test
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/manual/sharding-proxy/" title="Sharding-Proxy" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-proxy/">
          <b>4.2. </b>Sharding-Proxy
          
      </a>
      
      
        <ul>
          
          
          
          
        
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-proxy/usage/" title="User Manual" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-proxy/usage/">
        <b>4.2.1. </b>User Manual
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-proxy/configuration/" title="Configuration Manual" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-proxy/configuration/">
        <b>4.2.2. </b>Configuration Manual
        
        </a>
    </li>
     
  
 

            
          
            
            


 
  
    
      <li data-nav-id="/en/manual/sharding-proxy/docker/" title="Docker Image" class="dd-item ">
        <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-proxy/docker/">
        <b>4.2.3. </b>Docker Image
        
        </a>
    </li>
     
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/en/manual/sharding-sidecar/" title="Sharding-Sidecar" class="dd-item 
        
        
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-sidecar/">
          <b>4.3. </b>Sharding-Sidecar
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/en/faq/" title="FAQ" class="dd-item 
        parent
        active
        
        ">
      <a href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/faq/">
          <b>5. </b>FAQ
          
      </a>
      
              
    </li>
  
 

          
         
    </ul>

    
    

    
    <section id="prefooter">
      <hr/>
      <ul>
      
        <li>
          <a class="padding">
            <i class="fa fa-fw fa-language"></i>
          <div class="select-style">
            <select id="select-language" onchange="location = this.value;">
          
          
          
              
              
                  
                    
                    
<option id="en" value="/document/legacy/3.x/document/en/faq/" selected>English</option>
                    
                  
              
                  
              
          
              
              
                  
              
                  
                    
                    
<option id="cn" value="/document/legacy/3.x/document/cn/faq/">Chinese</option>
                    
                  
              
          
        </select>
        <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
          width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
          <g>
            <g id="arrow-drop-down">
              <polygon points="0,63.75 127.5,191.25 255,63.75 		" />
            </g>
          </g>
        </svg>
        </div>
        </a>
        </li>
       
      
      
      </ul>
    </section>
    
    <section id="footer">
      <p></p>

    </section>
  </div>
</nav>





        <section id="body">
        <div id="overlay"></div>
        <div class="padding highlightable">
              
              <div>
                <div id="top-bar">
                
                
                <div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
                    <span id="sidebar-toggle-span">
                        <a href="#" id="sidebar-toggle" data-sidebar-toggle="">
                          <i class="fa fa-bars"></i>
                        </a>
                    </span>
                  
                  <span class="links">
                    
          
          
            
            
          
          
            <a href='https://shardingsphere.apache.org/document/legacy/3.x/document/en/'>ShardingSphere</a> > FAQ
          
         
          
           
                  </span>
                </div>
                
              </div>
            </div>
            

        
          <div id="chapter">
        
        <div id="body-inner">
          

        




<h4 id="1-how-to-debug-sql-if-it-is-not-executed-correctly-in-shardingsphere">1. How to debug SQL if it is not executed correctly in ShardingSphere？</h4>

<p>The answer is:</p>

<p>Sharding-Proxy and version after Sharding-JDBC 1.5.0 supports to configure <code>sql.show</code> which can print the parsing of SQL, rewriting of SQL, and final routing information to the info log.
The configuration of <code>sql.show</code> is OFF by default. To configure it ON.</p>

<h4 id="2-why-do-compilation-errors-arise-when-reading-sources">2. Why do compilation errors arise when reading sources?</h4>

<p>The answer is:</p>

<p>ShardingSphere uses lombok to implement minimal code. For details, please refer to <a href="https://projectlombok.org/download.html">lombok</a>.</p>

<p>sharding-orchestration-reg module needs to perform <code>mvn install</code> command to generate gRPC-related Java file according to the protobuf file.</p>

<h4 id="3-why-can-not-find-xsd-when-using-spring-namespace">3. Why can not find xsd when using Spring namespace?</h4>

<p>The answer is:</p>

<p>Deploying an XSD file to a public web address is not the requirement of the Spring namespace usage specification, but some users have such requirements, so we deploy the XSD file to the ShardingSphere website.
In fact, META-INF\spring.schemas in the jar package of sharding-jdbc-spring-namespace configures the position of xsd file：META-INF\namespace\sharding.xsd and META-INF\namespace\master-slave.xsd.</p>

<h4 id="4-how-to-solve-the-error-of-cloud-not-resolve-placeholder-in-string-value">4. How to solve the Error of Cloud not resolve placeholder &hellip; in string value &hellip;?</h4>

<p>The answer is:</p>

<p>Inline expression identifier can use <code>${...}</code> or <code>$-&gt;{...}</code>, but <code>${...}</code> is conflict with spring placeholder of properties, so use <code>$-&gt;{...}</code> on spring environment is better.</p>

<h4 id="5-why-does-the-inline-expression-return-a-floating-point-number-as-a-result">5. Why does the inline expression return a floating point number as a result?</h4>

<p>The answer is:</p>

<p>In Java, the division result of two integers is an integer, but in the inline expression, the division result is a floating point number by using of an integer by using Groovy syntax.
To return an integer, you need to change A/B to A.intdiv(B).</p>

<h4 id="6-do-you-need-to-configure-tables-without-sharding-into-sharding-rules-if-you-only-have-partial-databases-or-tables-for-sharding">6. Do you need to configure tables without Sharding into sharding rules, if you only have partial databases or tables for Sharding?</h4>

<p>The answer is:</p>

<p>Yes. Because ShardingSphere combines multiple data sources into a single logical data source. Therefore, ShardingSphere can not route those tables not configured in configuration rules.</p>

<p>But ShardingSphere provides two other ways to simplify the configuration.</p>

<p>Method 1: To configure default-data-source, thus if ShardingSphere does not find correct Sharding data source for tables, it will route the tables to the default data source.</p>

<p>Method 2: We can configure the datasources with Sharding and without Sharding in ShardingSphere, and to use different data sources in the application to handle the case of Sharding or not.</p>

<h4 id="7-does-shardingsphere-support-native-self-incrementing-primary-keys-in-addition-to-supporting-distributed-self-incrementing-primary-keys">7. Does ShardingSphere support native self-incrementing primary keys in addition to supporting distributed self-incrementing primary keys?</h4>

<p>The answer is:</p>

<p>Yes. However, there are restrictions on the use of native self-increment primary keys, which means that you cannot use native self-increment primary keys as Sharding columns at the same time.</p>

<p>Because ShardingSphere does not know the table structure, and native self-increment primary key is not included in the original SQL, so that ShardingSphere cannot parse the key into Sharding column, resulting in SQL being routed to multiple tables.
When the INSERT SQL is routed to one table, the native self-increment primary key has a value; When the INSERT SQL is routed to more than one table, it will be 0.</p>

<h4 id="8-why-does-an-exception-thrown-as-classcastexception-integer-can-not-cast-to-long-when-using-generic-long-type-with-singlekeytableshardingalgorithm">8. Why does an exception thrown as <code>ClassCastException: Integer can not cast to Long</code> when using generic Long Type with <code>SingleKeyTableShardingAlgorithm</code>?</h4>

<p>The answer is:</p>

<p>To ensure that the type of Sharding column in the database are consistent with the type of columns in the Sharding algorithm. For example, the column type in the database is int(11) and the Sharding column is Integer. If the Sharding column is Long, the column type in the database is bigint.</p>

<h4 id="9-why-is-an-exception-thrown-when-the-aggregate-column-without-an-alias-is-used-in-sqlsever-and-postgresql">9. Why is an exception thrown when the aggregate column without an alias is used in SQLSever and PostgreSQL?</h4>

<p>The answer is:</p>

<p>SQLServer and PostgreSQL will rename the aggregate column without an alias. For example, the following SQL:</p>

<pre><code class="language-sql">SELECT SUM(num), SUM(num2) FROM tablexxx;
</code></pre>

<p>SQLServer gets the column of empty string and (2), and PostgreSQL gets the columns of empty sum and sum(2), which will cause ShardingSphere to fail to find the corresponding column when the result is merged.</p>

<p>The correct SQL is：</p>

<pre><code class="language-sql">SELECT SUM(num) AS sum_num, SUM(num2) AS sum_num2 FROM tablexxx;
</code></pre>

<h4 id="10-why-does-the-oracle-throw-an-exception-order-by-value-must-implements-comparable-when-you-use-the-order-by-statement-including-timestamp-column">10. Why does the Oracle throw an exception <code>Order by value must implements Comparable</code> when you use the Order By statement including Timestamp column?</h4>

<p>The answer is:</p>

<p>Two solutions:
1. Configure JVM parameters &ldquo;-oracle.jdbc.J2EE13Compliant=true&rdquo;
2. Set System.getProperties().setProperty(&ldquo;oracle.jdbc.J2EE13Compliant&rdquo;, &ldquo;true&rdquo;) in the project initial step;</p>

<p>The reason is:</p>

<p>com.dangdang.ddframe.rdb.sharding.merger.orderby.OrderByValue#getOrderValues():</p>

<pre><code class="language-java">    private List&lt;Comparable&lt;?&gt;&gt; getOrderValues() throws SQLException {
        List&lt;Comparable&lt;?&gt;&gt; result = new ArrayList&lt;&gt;(orderByItems.size());
        for (OrderItem each : orderByItems) {
            Object value = resultSet.getObject(each.getIndex());
            Preconditions.checkState(null == value || value instanceof Comparable, &quot;Order by value must implements Comparable&quot;);
            result.add((Comparable&lt;?&gt;) value);
        }
        return result;
    }
</code></pre>

<p>Because of using resultSet.getObject(int index)，TimeStamp oracle will decide to return java.sql.TimeStamp or oralce.sql.TIMESTAMP according to oracle.jdbc.J2EE13Compliant.</p>

<p>More detail, please refer to the ojdb sourcecode of coracle.jdbc.driver.TimestampAccessor#getObject(int var1)：</p>

<pre><code class="language-java">    Object getObject(int var1) throws SQLException {
        Object var2 = null;
        if(this.rowSpaceIndicator == null) {
            DatabaseError.throwSqlException(21);
        }

        if(this.rowSpaceIndicator[this.indicatorIndex + var1] != -1) {
            if(this.externalType != 0) {
                switch(this.externalType) {
                case 93:
                    return this.getTimestamp(var1);
                default:
                    DatabaseError.throwSqlException(4);
                    return null;
                }
            }

            if(this.statement.connection.j2ee13Compliant) {
                var2 = this.getTimestamp(var1);
            } else {
                var2 = this.getTIMESTAMP(var1);
            }
        }

        return var2;
    }
</code></pre>

<h4 id="11-why-is-the-result-not-correct-when-using-proxool">11. Why is the result not correct when using <code>Proxool</code>.</h4>

<p>The answer is:</p>

<p>When using Proxool to configuration multiple data sources, should set alias for every data sources. Because of get connection on Proxool will judge alias whether exist in the pool. If alias absent, Proxool will get connection from same data source.</p>

<p>Key source code of ProxoolDataSource.getConnection():</p>

<pre><code class="language-java">    if(!ConnectionPoolManager.getInstance().isPoolExists(this.alias)) {
        this.registerPool();
    }
</code></pre>

<p>Read more details on alias, refer to <a href="http://proxool.sourceforge.net/configure.html">Proxool</a>。</p>

<h4 id="12-why-does-shardingsphere-provide-the-primary-key-generated-by-the-default-distributed-auto-increment-primary-strategy-is-not-continuous-and-its-mantissa-mostly-is-even">12. Why does ShardingSphere provide the primary key generated by the default distributed auto-increment primary strategy is not continuous, and its mantissa mostly is even?</h4>

<p>The answer is:</p>

<p>ShardingSphere uses the snowflake algorithm as the default distributed self-increasing primary key strategy to decentralized compute the unique self-increment primary key. Therefore, self-increment primary key can be increasing but not sequential.</p>

<p>The last four bits of the primary key computed by the snowflake algorithm represent the incremental values in one millisecond. Therefore, if the concurrency of applications is not high in one millisecond, the chance of the last four being zero are high.</p>

<p>The problem of mantissa mostly even is solved at version 3.1.0, FIY: <a href="https://github.com/sharding-sphere/sharding-sphere/issues/1617">https://github.com/sharding-sphere/sharding-sphere/issues/1617</a></p>


<footer class=" footline" >
	
</footer>

        
            </div> 
        
        </div> 
        

      </div>

    <div id="navigation">
        
        
        
        
            
            
                
                    
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                        
                        
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
        
        


        
            <a class="nav nav-prev" href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/manual/sharding-sidecar/" title="Sharding-Sidecar"> <i class="fa fa-chevron-left"></i></a>
        
        
            <a class="nav nav-next" href="https://shardingsphere.apache.org/document/legacy/3.x/document/en/overview/" title="Overview" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
        
    </div>

    </section>
    
    <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
      <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
    </div>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/clipboard.min.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/perfect-scrollbar.min.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/perfect-scrollbar.jquery.min.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/jquery.sticky.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/featherlight.min.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/html5shiv-printshiv.min.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/highlight.pack.js?1547543307"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/modernizr.custom.71422.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/learn.js?1547543307"></script>
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/document/js/hugo-learn.js?1547543307"></script>

    <link href="https://shardingsphere.apache.org/document/legacy/3.x/mermaid/mermaid.css?1547543307" type="text/css" rel="stylesheet" />
    <script src="https://shardingsphere.apache.org/document/legacy/3.x/mermaid/mermaid.js?1547543307"></script>
    <script>
        mermaid.initialize({ startOnLoad: true });
    </script>
    

  </body>
</html>

